package com.zh.rent.test;

import lombok.SneakyThrows;

public class X implements Runnable {
    private  int x;
    private volatile int y;
    @SneakyThrows
    public static void main(String[] args){
        X that = new X();
        for(;;) {
           // Thread.sleep(1000);

            new Thread(that).start();
            new Thread(that).start();
        }
    }
    @SneakyThrows
    @Override
    public  void run() {
            x++;
            y++;
            System.out.println("x = " + x + ", y = " + y);
    }


}
